package com.jieshuibao.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jieshuibao.mapper.DutyMapper;
import com.jieshuibao.model.db.Duty;
import com.jieshuibao.model.db.DutyExample;

@Service
public class DutyService{
	
	@Resource
	private DutyMapper dutyMapper;
	
	public void addDuty(Duty duty) {
		dutyMapper.insertSelective(duty);
	}
	
	public void delDutyById(String id) {
		dutyMapper.deleteByPrimaryKey(id);
	}
	
	public void updateDuty(Duty duty) {
		dutyMapper.updateByPrimaryKeySelective(duty);
	}
	
	public Duty getDutyById(String id) {
		return dutyMapper.selectByPrimaryKey(id);
	}
	
	public List<Duty> getPageDuty(DutyExample dutyExample) {
		return dutyMapper.selectPage(dutyExample);
	}
	
	public int countDuty(DutyExample dutyExample) {
		return dutyMapper.countByExample(dutyExample);
	}
}
